package com.chenfan.mcn.model;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chenfan.mcn.constant.NumberFormatCst;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 商务提成明细
 * </p>
 *
 * @author lizhejin
 * @since 2021-06-07
 */
@Data
@TableName("business_commission_detail")
public class BusinessCommissionDetail implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 商务提成明细id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商务提成id
     */
    private Long businessId;

    /**
     * 合同编号
     */
    @Excel(name = "合同编号", orderNum = "1")
    private String incomeCode;

    /**
     * 客户id
     */
    private Long customerId;

    /**
     * 合同金额
     */
    @Excel(name = "合同总金额", type = 10, orderNum = "3")
    private BigDecimal businessAmount;


    /**
     * 回款状态（0未回款；1部分回款；2已回款）
     */
    @Excel(name = "回款状态", replace = {"未回款_0", "部分回款_1", "已回款_2"}, orderNum = "5")
    private Integer payBackStatus;

    /**
     * 合同签订时间
     */
    private Date signDate;

    /**
     * 客户评分
     */
    private String customerScore;

    /**
     * 是否为新客户首单（0非客户首单；1是客户首单）
     */
    @Excel(name = "是否为新客户首单", replace = {"非客户首单_0", "客户首单_1"}, orderNum = "7")
    private Integer customerFirstOrder;

    /**
     * 总提点
     */
    @Excel(name = "个人总提点", numFormat = NumberFormatCst.PERCENT, orderNum = "8")
    private BigDecimal generalPoints;

    /**
     * 是否为重点客户（0-是，1-否）
     */
    @Excel(name = "是否为重点客户", replace = {"是_0", "否_1"}, orderNum = "9")
    private Integer keyCustomers;

    /**
     * 目标达成率
     */
    @Excel(name = "客户目标达成率", numFormat = NumberFormatCst.PERCENT, orderNum = "10")
    private BigDecimal targetAchievementRate;

    /**
     * 个人提成
     */
    @Excel(name = "个人提成", type = 10, orderNum = "13")
    private BigDecimal personalCommission;

    /**
     * 部门负责人id
     */
    private Long departmentHeadId;

    /**
     * 部门负责人名称
     */
    @Excel(name = "部门负责人", orderNum = "15")
    private String departmentHeadName;

    /**
     * 回款率
     */
    @Excel(name = "回款率", numFormat = NumberFormatCst.PERCENT, orderNum = "16")
    private BigDecimal returnRate;

    /**
     * 回款系数
     */
    @Excel(name = "回款系数", numFormat = NumberFormatCst.PERCENT, orderNum = "17")
    private BigDecimal returnFactor;

    /**
     * 部门负责人提成点
     */
    @Excel(name = "部门负责人提成点", numFormat = NumberFormatCst.PERCENT, orderNum = "18")
    private BigDecimal departmentHeadCommissionPoint;

    /**
     * 部门目标达成率
     */
    private BigDecimal departmentTargetAchievementRate;

    /**
     * 部门负责人提成
     */
    @Excel(name = "部门负责人提成", type = 10, orderNum = "21")
    private BigDecimal departmentHeadCommission;

    /**
     * 提成人id
     */
    private Long commissionId;

    /**
     * 提成人名称
     */
    @Excel(name = "提成人", orderNum = "12")
    private String commissionName;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间", exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "23")
    private Date createDate;

    /**
     * 是否删除（0-正常，1-删除）
     */
    private Integer isDelete;

    /**
     * 是否确认提成单(0-否，1-是)
     */
    private Integer isConfirmed;

    /**
     * 项目销售额
     */
    private BigDecimal projectSales;

    /**
     * 收入合同id
     */
    private Long incomeId;

    /**
     * 临时表编号
     */
    private String temporaryCode;

    /**
     * 提成人工号
     */
    @Excel(name = "提成人工号", orderNum = "11")
    private String jobNumber;

    /**
     * 部门负责人工号
     */
    @Excel(name = "部门负责人工号", orderNum = "14")
    private String departmentJobNumber;

    /**
     * 是否作废
     */
    private Integer isInvalid;

    /**
     * 备注
     */
    @Excel(name = "备注", orderNum = "18")
    private String remark;

    /**
     * 执行单ID
     */
    private Long excuteId;

    /**
     * 执行单code
     */
    private String excuteCode;

}
